<template>
	<view>
		<u-navbar :title="title" :bgColor='bgColor' :titleStyle="titleStyle + 'font-weight: bold;font-size: 32rpx;'"
			:leftIconColor='leftIconColor' :placeholder="placeholder" :fixed="fixed" :safeAreaInsetTop="safeAreaInsetTop"
			autoBack :leftIconSize="!isShowLeft ? '0' : '20px'" @leftClick="onLeftClick">
			<view class="u-nav-slot" slot="left" v-if="isShowLeft">
				<u-icon name="arrow-left" size="19"></u-icon>
				<u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
				<u-icon name="home" size="20"></u-icon>
			</view>
		</u-navbar>
	</view>
</template>

<script>
	export default {
		props: {
			title: {
				type: String
			},
			isShowLeft: {
				type: Boolean,
				default: true
			},
			bgColor: {
				type: String,
				default: '#fff'
			},
			titleStyle: {
				type: String,
				default: ''
			},
			leftIconColor: {
				type: String,
				default: '#000'
			},
			placeholder: {
				type: Boolean,
				default: true
			},
			fixed: {
				type: Boolean,
				default: true
			},
			safeAreaInsetTop: {
				type: Boolean,
				default: true
			},
			isLeftClick: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {}
		},
		methods: {
			back() {
				this.$Router.back()
			},
			onLeftClick() {
				if (this.isLeftClick) {
					this.$Router.pushTab({
						name: 'stageIndex'
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	/* #ifndef APP-NVUE */
	page {
		background-color: $u-bg-color;
	}

	/* #endif */

	.u-page {
		padding: 0;
		flex: 1;
		background-color: $u-bg-color;

		&__item {

			&__title {
				color: $u-tips-color;
				background-color: $u-bg-color;
				padding: 15px;
				font-size: 15px;

				&__slot-title {
					color: $u-primary;
					font-size: 14px;
				}
			}
		}
	}

	.u-nav-slot {
		@include flex;
		align-items: center;
		justify-content: space-between;
		border: 2rpx solid $u-border-color;
		border-radius: 100px;
		padding: 3px 7px;
		opacity: 0.8;
	}
</style>